package it.ap.sa.acqua.fish.service.converter;

import org.springframework.stereotype.Component;

import it.ap.sa.acqua.dao.beans.TFishBean;
import it.ap.sa.acqua.dao.model.TFish;
import it.ap.sa.core.util.IBeanPopulate;

/**
 * Converter tra {@link TFish} e {@link TFishBean}
 * @author Alessandro Paolillo
 */
@Component
public class FishConverter implements IBeanPopulate<TFish, TFishBean>{

	public FishConverter() {
	}

	/**
	 * @author Alessandro Paolillo
	 * @see it.eng.tz.core.util.IBeanPopulate#convertdbToPage(java.lang.Object)
	 */
	@Override
	public TFishBean convertdbToPage(TFish src) throws Exception {
		TFishBean result = new TFishBean();
		result.setAcquariumType(src.getAcquariumType());
		result.setCareLevel(src.getCareLevel());
		result.setCommonName(src.getCommonName());
		result.setDescription(src.getDescription());
		result.setDiet(src.getDiet());
		result.setGhMax(src.getGhMax());
		result.setGhMin(src.getGhMin());
		result.setId(src.getId());
		result.setIdFamily(src.getIdFamily());
		result.setMaxLength(src.getMaxLength());
		result.setMinNumber(src.getMinNumber());
		result.setOrigin(src.getOrigin());
		result.setOriginZone(src.getOriginZone());
		result.setPhMax(src.getPhMax());
		result.setPhMin(src.getPhMin());
		result.setScientificName(src.getScientificName());
		result.setSynonymous(src.getSynonymous());
		result.setTankLevel(src.getTankLevel());
		result.setTankMinLength(src.getTankMinVolume());
		result.setTankMinVolume(src.getTankMinVolume());
		result.setTemperament(src.getTemperament());
		result.setTemperatureMax(src.getTemperatureMax());
		result.setTemperatureMin(src.getTemperatureMin());
		result.setWaterFlow(src.getWaterFlow());
		return result;
	}
	
	/**
	 * @author Alessandro Paolillo
	 * @see it.eng.tz.core.util.IBeanPopulate#convertpageToDb(java.lang.Object)
	 */
	@Override
	public TFish convertpageToDb(TFishBean src) throws Exception {
		throw new IllegalArgumentException("Metodo non implementato");
	}

}
